package com.jy.oms.framework.asyn.task.model;

import java.util.Date;

/**
 * wrapper
 *
 * @author liuquan
 */
public class TaskWrapper {

    private String taskCode;

    private TaskDto taskDto;

    /**
     * 任务组标识
     */
    private String taskGroup;

    /**
     * 任务队列ID，具有唯一性，插入任务时无需传入
     */
    private String taskQueueId;

    /**
     * 已执行次数
     */
    private int callCount;

    /**
     * 立即执行
     */
    private boolean executeImmediate;

    /**
     * 立即执行失败时是否需要重试
     */
    private boolean executeImmediateRetryOnFailure = true;

    /**
     * 任务参数标识
     */
    private String paramIdentifier;

    /**
     * 任务最早执行时间
     */
    private Date earliestExecuteTime;

    public String getTaskCode() {
        return taskCode;
    }

    public TaskWrapper setTaskCode(String taskCode) {
        this.taskCode = taskCode;
        return this;
    }

    public TaskDto getTaskDto() {
        return taskDto;
    }

    public TaskWrapper setTaskDto(TaskDto taskDto) {
        this.taskDto = taskDto;
        return this;
    }

    public String getTaskGroup() {
        return taskGroup;
    }

    public TaskWrapper setTaskGroup(String taskGroup) {
        this.taskGroup = taskGroup;
        return this;
    }

    public String getTaskQueueId() {
        return taskQueueId;
    }

    public TaskWrapper setTaskQueueId(String taskQueueId) {
        this.taskQueueId = taskQueueId;
        return this;
    }

    public int getCallCount() {
        return callCount;
    }

    public TaskWrapper setCallCount(int callCount) {
        this.callCount = callCount;
        return this;
    }

    public boolean isExecuteImmediate() {
        return executeImmediate;
    }

    public TaskWrapper setExecuteImmediate(boolean executeImmediate) {
        this.executeImmediate = executeImmediate;
        return this;
    }

    public String getParamIdentifier() {
        return paramIdentifier;
    }

    public TaskWrapper setParamIdentifier(String paramIdentifier) {
        this.paramIdentifier = paramIdentifier;
        return this;
    }

    public Date getEarliestExecuteTime() {
        return earliestExecuteTime;
    }

    public TaskWrapper setEarliestExecuteTime(Date earliestExecuteTime) {
        this.earliestExecuteTime = earliestExecuteTime;
        return this;
    }

    public boolean isExecuteImmediateRetryOnFailure() {
        return executeImmediateRetryOnFailure;
    }

    public TaskWrapper setExecuteImmediateRetryOnFailure(boolean executeImmediateRetryOnFailure) {
        this.executeImmediateRetryOnFailure = executeImmediateRetryOnFailure;
        return this;
    }
}
